
Vue.component2('a_1_0_2_30_1', {  
    template: `
        <div  :class="{ 'a_1_0_2_30_1_lines test': data.true, 'a_1_0_2_30_1_lines_onclick': data.onclick_flag }" @click="handle_click" v-show="show_flag">
        <span :style="'padding-left: '+data._space_+'px;'"></span>
        <span  v-if="data.icon1_show_flag":class="{'icon iconfont':data.true,'icon-right':data.close,'icon-down':data.close==false}"></span>
        
        <span  class="a_1_0_2_30_1_hid_line" style="color:#bcbcbc">{{data.name}}</span>
        <div style="display:inline-block;flex:1;">
        <div style="display:flex;
    justify-content: flex-end;
    display: flex;">
    
        <div  @click="click1($event,k)" v-for="(v,k) in data.icon_data"
        :key="k">
         <a_1_0_3_0_0 style="display: inline-block;"
         :deepcopy_data="v"></a_1_0_3_0_0>
        </div>
        </div>
        </div>
        </div>
`,
data(){
    return{
        show_flag:true,
        data:{
            onclick_flag:false,
            tree_data:{},//
            icon_data:{},
            icon1_show_flag:true,
            click:null,
            click_obj:null,
            true:true,
            false:false,
            close:true,
            name:"",
            _space_:0,
        }
    }
},
methods:{
    handle_click:async function(event){
        //点击当前 高亮显示
        try{//console.log("高亮",this.data.path);
this.data.tree_data.set_onclick_flag(this.data.path)}catch{}
        // /* console.log("我点击了一次")*/
        try{
            if(!this.data.tree_data.check_dct[this.data.path]){
                await this.data.刷新目录1();
            }
            /*console.log("?2")*/}
        catch{}

        if (this.data.click){
            try{
                this.data.click(event)
            
                // console.log("start click2")
            }
            catch{}
            return 
        }


        if (this.data.click_obj){
            try{
                lhp_run_func(this.data.click_obj.func,this.data.click_obj.args)
            
                // console.log("start click3")
            }
            catch{}
            return 
        }
        try{
            this.data.click_handle(this.data.path,this.data.close);
        }catch{}
    },
    click1:async function(event,k){
       /* console.log(',,,',this.data.icon_data[k].click)*/
        lhp_run_func(this.data.icon_data[k].click);
        if(!this.data.click_stop){event.stopPropagation();}//阻止父级

    }
},

mounted:function(){
    /*console.log("210的deepcopydata",_this.deepcopy_data)*/
let tree_data=_this.deepcopy_data.tree_data;
_this.data.全局配置对象=tree_data['全局配置对象'];
_this.data.add_new=function(name){
    
//更新数据 

//更新数据 
let update_val={
    "type":"change_data",
    "data_type":"set_list",//类型 修改数据
    update_params:[
      {//将路径为path的数据 进行 +1操作 并且存入属性add中 提供给data里面携带@add的属性调用
        name:'@index',
        path:`page_config.dict.1.base_info.index`,//数据路径
        use:'++s'
      },
    ],
    "postput":[{
        'path':`page_config.dict.1.dict.@index`,
        'data':{
            "base_info":{
                "index":2,
                "deepcopy_data":{"name":name},"vue_name":"a_1_0_2_31_1"},
            "dict":{
                "1":{
                    "base_info":{
                        "index":0,
                        "deepcopy_data":{"name":"组件大纲"},"con":"1","vue_name":"a_1_0_2_34_1","width":"1960px","height":"1080px","scale":"55"
                    },
                    "dict":{},
                    "page_dict":{}
                },
                "2":{
                    "base_info":{
                        "index":0,
                        "deepcopy_data":{"name":"页面代码"},"vue_name":"a_1_0_2_36_1",
                    },
                    "dict":{}
                },
            }
        }
      },
      {
        'path':`page_config.dict.1.base_info`,
        'data':{
            "index":"@index",
        }
      },
    
    ],
  }
//向服务端websocket发送消息
_this.data.全局配置对象.更新(update_val);
}


_this.data.icon_data={
    100:{
        icon_class:"icon iconfont icon-qianduan",
        hovertext:"添加新页面",
        click:async function(){
        _this.$prompt('输入新页面名称', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
          }).then(({ value }) => {
            try{_this.data.add_new(value);}
            catch (err){
                console.log("出错..",err)
            }
            
          }).catch(() => {
            _this.$message({
              type: 'info',
              message: '取消输入'
            });       
          });
        }
        },
}


}

})